/**
 *  问答相关
 */

import request from '@/utils/request.js';
import { HTTP_REQUEST_URL } from '@/config/index.js';

const api = {}

// 查询问答列表
api.getList = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/ask/index',
	data: data,
})

// 添加问答
api.add = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/ask/add',
	data: data,
})

// 删除问答
api.delete = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/ask/del',
	data: data,
})

// 问答详情
api.info = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/ask/info',
	data: data,
})

// 上传图片
api.upload = data => request.uploadFile({
	url: HTTP_REQUEST_URL + '/files/upload',
	filePath: data.filePath,
	name: 'file',
	data: {
		accept: 'image',
		dir: 'ask',
		category_id: '6',
		type: 1,
	},
})

export default api